﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using CommunitySystem.Assert;
using CommunitySystem.Ctrls;
using CommunitySystem.Views;
using CommunitySystem.ZhaoLuService;
using EHR.Common;
using GetExcelFileCompletedEventArgs = CommunitySystem.PublicOfficialSelectionService.GetExcelFileCompletedEventArgs;

namespace CommunitySystem
{
    public partial class ZL_ZhiWeiShiJianAnPaiControl1 : AsyncCtrl, IReturnListenerc
    {
        #region IReturnListenerc 成员
        public void BeginReturn()
        {
            //Load();
        }
        #endregion

        private int ExId = 0;
        public NavMoveSwitch Nav { get; set; }
        private ZhaoLuService.ZhaoLuServiceClient Client1 =
            new ZhaoLuService.ZhaoLuServiceClient();
        private ObservableCollection<ZhaoLu_DaoRuKaoShengModel> models =
            new ObservableCollection<ZhaoLu_DaoRuKaoShengModel>();
        Dictionary<string, bool> liststring = new Dictionary<string, bool>();
        public string DaoChuZu { get; set; }
        public ZL_ZhiWeiShiJianAnPaiControl1(int exameID)
        {
            InitializeComponent();
            ExId = exameID;
            liststring.Add("面试日期", true);
            liststring.Add("场次", true);
            liststring.Add("面试时间", true);
            liststring.Add("招录单位", true);
            liststring.Add("用人部门", true);
            liststring.Add("报考职位", true);

            liststring.Add("注册编号", true);

            liststring.Add("姓名", true);
            liststring.Add("身份证号", true);
            liststring.Add("职位ID", true);

            liststring.Add("招考科目", true);
            liststring.Add("考试类别", true);
            liststring.Add("是否调剂", true);
            liststring.Add("总分", true);
            liststring.Add("性别", true);
            liststring.Add("出生日期", true);
            liststring.Add("健康程度", true);
            liststring.Add("民族", true);
            liststring.Add("婚姻状况", true);
            liststring.Add("考生身份", true);
            liststring.Add("学历", true);

            liststring.Add("政治面貌", true);
            liststring.Add("学位", true);
            liststring.Add("本科毕业院校", true);
            liststring.Add("本科专业", true);
            liststring.Add("硕士毕业院校", true);
            liststring.Add("硕士专业", true);
            liststring.Add("博士毕业院校", true);
            liststring.Add("博士专业", true);
            liststring.Add("个人简历", true);
            liststring.Add("通讯地址", true);
            liststring.Add("联系方式", true);

            liststring.Add("手机号码", true);
            liststring.Add("工作单位", true);
            liststring.Add("工作年限", true);
            liststring.Add("生源", true);
            liststring.Add("户籍", true);
            liststring.Add("邮编", true);
            liststring.Add("报名备注信息", true);
            Client1.GetExcelFileCompleted += new EventHandler<ZhaoLuService.GetExcelFileCompletedEventArgs>(Client1_GetExcelFileCompleted);
            Client1.ZL_GetMianShiTongZhiBiaoCompleted += new EventHandler<ZL_GetMianShiTongZhiBiaoCompletedEventArgs>(Client1_ZL_GetMianShiTongZhiBiaoCompleted);
            LoadListBox();
            Load();
            zucha.DataContext = this;
        }

        void Client1_GetExcelFileCompleted(object sender, ZhaoLuService.GetExcelFileCompletedEventArgs e)
        {
            List<byte> content = e.UserState as List<byte>;
            FileTransferStream fff = e.Result;
            if (fff.IsFinished == false)
            {
                content.AddRange(fff.FileContent);
                Client1.GetExcelFileAsync(null, null, models, Session.LoginUser.LoginName, liststring, content);
            }
            else
            {
                content.AddRange(fff.FileContent);
                byte[] bytes = content.ToArray();
                ExportPersonnelInfo.Write(bytes, 0, bytes.Length);
                ExportPersonnelInfo.Close();
                ExportPersonnelInfo.Dispose();
                SilverlightMessageBoxLibrary.Message.InfoMessage("保存成功!");
            }
        }
        


        void Client1_ZL_GetMianShiTongZhiBiaoCompleted(object sender, ZL_GetMianShiTongZhiBiaoCompletedEventArgs e)
        {
            DGRole.ItemsSource = e.Result;
            models = e.Result;
        }

        private void LoadListBox()
        {
            foreach (string i in liststring.Keys)
            {
                CheckBox cbMonth = new CheckBox();
                cbMonth.Content = i;
                cbMonth.IsChecked = true;
                cbMonth.Checked += new RoutedEventHandler(cbMonth_Checked);
                cbMonth.Unchecked += new RoutedEventHandler(cbMonth_UnChecked);
                ListBoxOfLife.Items.Add(cbMonth);
            }

        }
        DateTime? dt = null;
        public void Load()
        {

            Client1.ZL_GetMianShiTongZhiBiaoAsync(ExId, !string.IsNullOrEmpty(riqi11.Text) ? Convert.ToDateTime(riqi11.Text) : dt,
                DaoChuZu, ((ComboBoxItem)status.SelectedItem).Content.ToString());

        }


        private void cbMonth_Checked(object sender, RoutedEventArgs e)
        {
                switch (((CheckBox)sender).Content.ToString())
                {
                    case "面试日期":
                        this.DGRole.Columns[1].Visibility = System.Windows.Visibility.Visible;
                        liststring["面试日期"] = true;
                        break;
                    case "场次":
                        this.DGRole.Columns[2].Visibility = System.Windows.Visibility.Visible;
                        liststring["场次"] = true;
                        break;
                    case "面试时间":
                        this.DGRole.Columns[3].Visibility = System.Windows.Visibility.Visible;
                        liststring["面试时间"] = true;
                        break;
                    case "招录单位":
                        this.DGRole.Columns[4].Visibility = System.Windows.Visibility.Visible;
                        liststring["招录单位"] = true;
                        break;
                    case "用人部门":
                        this.DGRole.Columns[5].Visibility = System.Windows.Visibility.Visible;
                        liststring["用人部门"] = true;
                        break;
                    case "报考职位":
                        this.DGRole.Columns[6].Visibility = System.Windows.Visibility.Visible;
                        liststring["报考职位"] = true;
                        break;
                    case "注册编号":
                        this.DGRole.Columns[7].Visibility = System.Windows.Visibility.Visible;
                        liststring["注册编号"] = true;
                        break;

                    case "姓名":
                        this.DGRole.Columns[8].Visibility = System.Windows.Visibility.Visible;
                        liststring["姓名"] = true;
                        break;
                    case "身份证号":
                        this.DGRole.Columns[9].Visibility = System.Windows.Visibility.Visible;
                        liststring["身份证号"] = true;
                        break;
                    case "职位ID":
                        this.DGRole.Columns[10].Visibility = System.Windows.Visibility.Visible;
                        liststring["职位ID"] = true;
                        break;
                    case "招考科目":
                        this.DGRole.Columns[11].Visibility = System.Windows.Visibility.Visible;
                        liststring["招考科目"] = true;
                        break;
                    case "考试类别":
                        this.DGRole.Columns[12].Visibility = System.Windows.Visibility.Visible;
                        liststring["考试类别"] = true;
                        break;
                    case "是否调剂":
                        this.DGRole.Columns[13].Visibility = System.Windows.Visibility.Visible;
                        liststring["是否调剂"] = true;
                        break;
                    case "总分":
                        this.DGRole.Columns[14].Visibility = System.Windows.Visibility.Visible;
                        liststring["总分"] = true;
                        break;

                    case "性别":
                        this.DGRole.Columns[15].Visibility = System.Windows.Visibility.Visible;
                        liststring["性别"] = true;
                        break;
                    case "出生日期":
                        this.DGRole.Columns[16].Visibility = System.Windows.Visibility.Visible;
                        liststring["出生日期"] = true;
                        break;
                    case "健康程度":
                        this.DGRole.Columns[17].Visibility = System.Windows.Visibility.Visible;
                        liststring["健康程度"] = true;
                        break;
                    case "民族":
                        this.DGRole.Columns[18].Visibility = System.Windows.Visibility.Visible;
                        liststring["民族"] = true;
                        break;
                    case "婚姻状况":
                        this.DGRole.Columns[19].Visibility = System.Windows.Visibility.Visible;
                        liststring["婚姻状况"] = true;
                        break;
                    case "考生身份":
                        this.DGRole.Columns[20].Visibility = System.Windows.Visibility.Visible;
                        liststring["考生身份"] = true;
                        break;
                    case "学历":
                        this.DGRole.Columns[21].Visibility = System.Windows.Visibility.Visible;
                        liststring["学历"] = true;
                        break;

                    case "政治面貌":
                        this.DGRole.Columns[22].Visibility = System.Windows.Visibility.Visible;
                        liststring["政治面貌"] = true;
                        break;
                    case "学位":
                        this.DGRole.Columns[23].Visibility = System.Windows.Visibility.Visible;
                        liststring["学位"] = true;
                        break;
                    case "本科毕业院校":
                        this.DGRole.Columns[24].Visibility = System.Windows.Visibility.Visible;
                        liststring["本科毕业院校"] = true;
                        break;
                    case "本科专业":
                        this.DGRole.Columns[25].Visibility = System.Windows.Visibility.Visible;
                        liststring["本科专业"] = true;
                        break;
                    case "硕士毕业院校":
                        this.DGRole.Columns[26].Visibility = System.Windows.Visibility.Visible;
                        liststring["硕士毕业院校"] = true;
                        break;
                    case "硕士专业":
                        this.DGRole.Columns[27].Visibility = System.Windows.Visibility.Visible;
                        liststring["硕士专业"] = true;
                        break;
                    case "博士毕业院校":
                        this.DGRole.Columns[28].Visibility = System.Windows.Visibility.Visible;
                        liststring["博士毕业院校"] = true;
                        break;
                    case "博士专业":
                        this.DGRole.Columns[29].Visibility = System.Windows.Visibility.Visible;
                        liststring["博士专业"] = true;
                        break;

                    case "个人简历":
                        this.DGRole.Columns[30].Visibility = System.Windows.Visibility.Visible;
                        liststring["个人简历"] = true;
                        break;
                    case "通讯地址":
                        this.DGRole.Columns[31].Visibility = System.Windows.Visibility.Visible;
                        liststring["通讯地址"] = true;
                        break;

                    case "联系方式":
                        this.DGRole.Columns[32].Visibility = System.Windows.Visibility.Visible;
                        liststring["联系方式"] = true;
                        break;
                    case "手机号码":
                        this.DGRole.Columns[33].Visibility = System.Windows.Visibility.Visible;
                        liststring["手机号码"] = true;
                        break;
                    case "工作单位":
                        this.DGRole.Columns[34].Visibility = System.Windows.Visibility.Visible;
                        liststring["工作单位"] = true;
                        break;
                    case "工作年限":
                        this.DGRole.Columns[35].Visibility = System.Windows.Visibility.Visible;
                        liststring["工作年限"] = true;
                        break;
                    case "生源":
                        this.DGRole.Columns[36].Visibility = System.Windows.Visibility.Visible;
                        liststring["生源"] = true;
                        break;
                    case "户籍":
                        this.DGRole.Columns[37].Visibility = System.Windows.Visibility.Visible;
                        liststring["户籍"] = true;
                        break;
                    case "邮编":
                        this.DGRole.Columns[38].Visibility = System.Windows.Visibility.Visible;
                        liststring["邮编"] = true;
                        break;
                    case "报名备注信息":
                        this.DGRole.Columns[39].Visibility = System.Windows.Visibility.Visible;
                        liststring["报名备注信息"] = true;
                        break;
                }
            


        }

        private void cbMonth_UnChecked(object sender, RoutedEventArgs e)
        {
            
                switch (((CheckBox)sender).Content.ToString())
                {
                    case "面试日期":
                        this.DGRole.Columns[1].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["面试日期"] = false;
                        break;
                    case "场次":
                        this.DGRole.Columns[2].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["场次"] = false;
                        break;
                    case "面试时间":
                        this.DGRole.Columns[3].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["面试时间"] = false;
                        break;
                    case "招录单位":
                        this.DGRole.Columns[4].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["招录单位"] = false;
                        break;
                    case "用人部门":
                        this.DGRole.Columns[5].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["用人部门"] = false;
                        break;
                    case "报考职位":
                        this.DGRole.Columns[6].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["报考职位"] = false;
                        break;
                    case "注册编号":
                        this.DGRole.Columns[7].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["注册编号"] = false;
                        break;

                    case "姓名":
                        this.DGRole.Columns[8].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["姓名"] = false;
                        break;
                    case "身份证号":
                        this.DGRole.Columns[9].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["身份证号"] = false;
                        break;
                    case "职位ID":
                        this.DGRole.Columns[10].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["职位ID"] = false;
                        break;
                    case "招考科目":
                        this.DGRole.Columns[11].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["招考科目"] = false;
                        break;
                    case "考试类别":
                        this.DGRole.Columns[12].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["考试类别"] = false;
                        break;
                    case "是否调剂":
                        this.DGRole.Columns[13].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["是否调剂"] = false;
                        break;
                    case "总分":
                        this.DGRole.Columns[14].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["总分"] = false;
                        break;

                    case "性别":
                        this.DGRole.Columns[15].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["性别"] = false;
                        break;
                    case "出生日期":
                        this.DGRole.Columns[16].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["出生日期"] = false;
                        break;
                    case "健康程度":
                        this.DGRole.Columns[17].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["健康程度"] = false;
                        break;
                    case "民族":
                        this.DGRole.Columns[18].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["民族"] = false;
                        break;
                    case "婚姻状况":
                        this.DGRole.Columns[19].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["婚姻状况"] = false;
                        break;
                    case "考生身份":
                        this.DGRole.Columns[20].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["考生身份"] = false;
                        break;
                    case "学历":
                        this.DGRole.Columns[21].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["学历"] = false;
                        break;

                    case "政治面貌":
                        this.DGRole.Columns[22].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["政治面貌"] = false;
                        break;
                    case "学位":
                        this.DGRole.Columns[23].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["学位"] = false;
                        break;
                    case "本科毕业院校":
                        this.DGRole.Columns[24].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["本科毕业院校"] = false;
                        break;
                    case "本科专业":
                        this.DGRole.Columns[25].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["本科专业"] = false;
                        break;
                    case "硕士毕业院校":
                        this.DGRole.Columns[26].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["硕士毕业院校"] = false;
                        break;
                    case "硕士专业":
                        this.DGRole.Columns[27].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["硕士专业"] = false;
                        break;
                    case "博士毕业院校":
                        this.DGRole.Columns[28].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["博士毕业院校"] = false;
                        break;
                    case "博士专业":
                        this.DGRole.Columns[29].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["博士专业"] = false;
                        break;

                    case "个人简历":
                        this.DGRole.Columns[30].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["个人简历"] = false;
                        break;
                    case "通讯地址":
                        this.DGRole.Columns[31].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["通讯地址"] = false;
                        break;

                    case "联系方式":
                        this.DGRole.Columns[32].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["联系方式"] = false;
                        break;
                    case "手机号码":
                        this.DGRole.Columns[33].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["手机号码"] = false;
                        break;
                    case "工作单位":
                        this.DGRole.Columns[34].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["工作单位"] = false;
                        break;
                    case "工作年限":
                        this.DGRole.Columns[35].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["工作年限"] = false;
                        break;
                    case "生源":
                        this.DGRole.Columns[36].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["生源"] = false;
                        break;
                    case "户籍":
                        this.DGRole.Columns[37].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["户籍"] = false;
                        break;
                    case "邮编":
                        this.DGRole.Columns[38].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["邮编"] = false;
                        break;
                    case "报名备注信息":
                        this.DGRole.Columns[39].Visibility = System.Windows.Visibility.Collapsed;
                        liststring["报名备注信息"] = false;
                        break;
                
            }
        }

        private void CheckBox_Checked(object sender, RoutedEventArgs e)
        {
            if (ListBoxOfLife != null)
                foreach (var item in ListBoxOfLife.Items)
                {
                    ((System.Windows.Controls.Primitives.ToggleButton)(item)).IsChecked = true;
                }

        }

        private void chkHiddenCols_Unchecked(object sender, RoutedEventArgs e)
        {
            if (ListBoxOfLife != null)
                foreach (var item in ListBoxOfLife.Items)
                {
                    ((System.Windows.Controls.Primitives.ToggleButton)(item)).IsChecked = false;
                }
        }

        private Stream ExportPersonnelInfo = null;
        private void MianShiData_Click(object sender, RoutedEventArgs e)
        {
            #region excel模板方式，但是没法自定义导出字段
            if (models != null)
            {
                var downLoad = new SaveFileDialog()
                {
                    //Filter = "Excel files(2007~2010) (*.xlsx)|*.xlsx|Excel files(2003) (*.xls)|*.xls", //"Excel files (*.xlsx)|*.xlsx|(*.xls)|*.xls",
                    Filter = "Excel files(2003) (*.xls)|*.xls",
                };
                if (downLoad.ShowDialog() == true)
                {
                    ExportPersonnelInfo = downLoad.OpenFile();
                    List<byte> content = new List<byte>();
                    //Client1.ZhaoLu_GetExcelFileAsync(models, Session.LoginUser.LoginName, liststring, content);
                    //Client1.GetExcelFileAsync(null, null, models, Session.LoginUser.LoginName, liststring, content);
                    Client1.ZhaoLu_GetExcelFile1Completed -= new EventHandler<ZhaoLu_GetExcelFile1CompletedEventArgs>(Client1_ZhaoLu_GetExcelFile1Completed);
                    Client1.ZhaoLu_GetExcelFile1Completed += new EventHandler<ZhaoLu_GetExcelFile1CompletedEventArgs>(Client1_ZhaoLu_GetExcelFile1Completed);
                    Client1.ZhaoLu_GetExcelFile1Async(ExId, !string.IsNullOrEmpty(riqi11.Text) ? Convert.ToDateTime(riqi11.Text) : dt,
                DaoChuZu, ((ComboBoxItem)status.SelectedItem).Content.ToString(), Session.LoginUser.LoginName, liststring, content);
                }
            }
            #endregion
        }

        private void ChaData_Click(object sender, RoutedEventArgs e)
        {
            Load();
        }

        void Client1_ZhaoLu_GetExcelFile1Completed(object sender, ZhaoLu_GetExcelFile1CompletedEventArgs e)
        {
            List<byte> content = e.UserState as List<byte>;
            FileTransferStream fff = e.Result;
            if (fff.IsFinished == false)
            {
                content.AddRange(fff.FileContent);
                //Client1.GetExcelFileAsync(null, null, models, Session.LoginUser.LoginName, liststring, content);
                  Client1.ZhaoLu_GetExcelFile1Completed -= new EventHandler<ZhaoLu_GetExcelFile1CompletedEventArgs>(Client1_ZhaoLu_GetExcelFile1Completed);
                  Client1.ZhaoLu_GetExcelFile1Completed += new EventHandler<ZhaoLu_GetExcelFile1CompletedEventArgs>(Client1_ZhaoLu_GetExcelFile1Completed);
                  Client1.ZhaoLu_GetExcelFile1Async(ExId, !string.IsNullOrEmpty(riqi11.Text) ? Convert.ToDateTime(riqi11.Text) : dt,
              DaoChuZu, ((ComboBoxItem)status.SelectedItem).Content.ToString(), Session.LoginUser.LoginName, liststring, content);
                
            }
            else
            {

                try
                {
                    content.AddRange(fff.FileContent);
                    byte[] bytes = content.ToArray();
                    ExportPersonnelInfo.Write(bytes, 0, bytes.Length);
                    ExportPersonnelInfo.Close();
                    ExportPersonnelInfo.Dispose();
                    //SilverlightMessageBoxLibrary.Message.InfoMessage("保存成功!");
                }
                catch
                {


                }
                finally
                {
                    SilverlightMessageBoxLibrary.Message.InfoMessage("保存成功!");
                }

            
        }
        }
        private WordActionService.WordActionClient _client = null;
        private void ExportInterview_Click(object sender, RoutedEventArgs e)
        {
            if (DGRole.SelectedItem != null)
            {
                if (_client == null)
                {
                    _client = new WordActionService.WordActionClient();
                    _client.ExportInterviewInfoCompleted += (sender1, e1) =>
                    {
                        //保存结果
                        if (e1.Error == null)
                        {
                            try
                            {
                                string serverpath = _client.InnerChannel.Via.AbsoluteUri.Replace(_client.InnerChannel.Via.AbsolutePath, "");
                                System.Windows.Browser.HtmlPage.Window.Navigate(new Uri(serverpath + e1.Result, UriKind.RelativeOrAbsolute));
                            }
                            catch (Exception ex)
                            {
                                SilverlightMessageBoxLibrary.Message.ErrorMessage("导出失败,可能原因:\n" + ex.Message);
                            }
                        }
                        else
                        {
                            SilverlightMessageBoxLibrary.Message.ErrorMessage("导出失败,可能原因:\n" + e1.Error);
                        }
                    };
                }
                foreach (var item in DGRole.SelectedItems)
                {
                    var entity = item as ZhaoLu_DaoRuKaoShengModel;
                    DateTime dt = (DateTime)entity.RiQi;
                    string dayOfWeek = null;
                    switch (dt.DayOfWeek)
                    {
                        case DayOfWeek.Monday:
                            dayOfWeek = "周一";
                            break;
                        case DayOfWeek.Tuesday:
                            dayOfWeek = "周二";
                            break;
                        case DayOfWeek.Wednesday:
                            dayOfWeek = "周三";
                            break;
                        case DayOfWeek.Thursday:
                            dayOfWeek = "周四";
                            break;
                        case DayOfWeek.Friday:
                            dayOfWeek = "周五";
                            break;
                        case DayOfWeek.Saturday:
                            dayOfWeek = "周六";
                            break;
                        case DayOfWeek.Sunday:
                            dayOfWeek = "周七";
                            break;

                    }
                    int hour = int.Parse(entity.Shi.Split(':')[0]);//DateTime.Parse(entity.Shi);
                    _client.ExportInterviewInfoAsync(new ObservableCollection<string>(){entity.XingMing, 

                    string.Format("{0}月 {1} 日（{2}）{3}{4}：{5}", dt.Month, dt.Day, 
                    dayOfWeek, hour >12? "下午" :"上午",  hour >12? "12" :"8", 
                     hour >12? "30" :"00" ),entity.DiDian}, 0); //上午8 点， 下午 12：30
                    System.Threading.Thread.Sleep(new TimeSpan(0, 0, 0, 1, 0));
                }
                //_client.ExportInterviewInfoAsync(new System.Collections.ObjectModel.ObservableCollection<string>() { entity., "3月 12 日（周一）上午8：00", "徐汇区委党校（上海市徐汇区钦州南路567号）二楼218会议室" }, 1);
            }
            else
            {
                SilverlightMessageBoxLibrary.Message.InfoMessage("请至少选中一条记录");
            }
        }
    }
}
